<th:block th:with="link=${@linkTag.selectCmsLinkById(linkId)}">
<div class="w-screen h-screen relative z-[1]">
    <!-- 主要内容区 -->
    <div class="bg-white rounded-lg shadow-lg overflow-hidden">
        <div class="p-6">
            <div class="flex flex-col md:flex-row">
                <!-- 左侧内容 -->
                <div class="md:w-2/3 pr-0 md:pr-6">
                    <header class="flex justify-center mb-8 mt-20">
                        <div class="flex items-center space-x-4">
                            <h1 class="text-3xl font-bold text-blue-600" th:text="${link.linkName}">
                                
                            </h1>
                        </div>
                    </header>
                    <h2 class="text-2xl font-bold mb-4">网站介绍</h2>
                    <p class="text-gray-700 mb-6" th:text="${link.description}">
                       
                    </p>

                    <div class="mb-2">
                        <h3 class="text-xl font-semibold mb-3">网站记录</h3>
                        <div class="flex flex-wrap gap-2">
                            <span
                                title="访问次数"
                                class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center"
                            >
                                <svg
                                    xmlns="http://www.w3.org/2000/svg"
                                    fill="none"
                                    viewBox="0 0 24 24"
                                    stroke-width="1.5"
                                    stroke="currentColor"
                                    class="size-6"
                                >
                                    <path
                                        stroke-linecap="round"
                                        stroke-linejoin="round"
                                        d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"
                                    ></path>
                                    <path
                                        stroke-linecap="round"
                                        stroke-linejoin="round"
                                        d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"
                                    ></path>
                                </svg>

                                <span>0</span>
                            </span>
                            <span
                                title="评论次数"
                                class="bg-orange-500 hover:bg-orange-600 text-white px-4 py-2 rounded-lg flex items-center"
                            >
                                <svg
                                    xmlns="http://www.w3.org/2000/svg"
                                    fill="none"
                                    viewBox="0 0 24 24"
                                    stroke-width="1.5"
                                    stroke="currentColor"
                                    class="size-6"
                                >
                                    <path
                                        stroke-linecap="round"
                                        stroke-linejoin="round"
                                        d="M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"
                                    ></path>
                                </svg>

                                <span>0</span>
                            </span>
                            <span
                                title="收藏数"
                                class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-lg flex items-center"
                            >
                                <svg
                                    xmlns="http://www.w3.org/2000/svg"
                                    fill="none"
                                    viewBox="0 0 24 24"
                                    stroke-width="1.5"
                                    stroke="currentColor"
                                    class="size-6"
                                >
                                    <path
                                        stroke-linecap="round"
                                        stroke-linejoin="round"
                                        d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"
                                    ></path>
                                </svg>

                                <span>0</span>
                            </span>
                            <span
                                title="分享数"
                                class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-lg flex items-center"
                            >
                                <svg
                                    xmlns="http://www.w3.org/2000/svg"
                                    fill="none"
                                    viewBox="0 0 24 24"
                                    stroke-width="1.5"
                                    stroke="currentColor"
                                    class="size-6"
                                >
                                    <path
                                        stroke-linecap="round"
                                        stroke-linejoin="round"
                                        d="M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"
                                    ></path>
                                </svg>
                                <span>0</span>
                            </span>
                            <span
                                title="赞"
                                class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-lg flex items-center"
                            >
                               <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
  <path stroke-linecap="round" stroke-linejoin="round" d="M6.633 10.25c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V2.75a.75.75 0 0 1 .75-.75 2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282m0 0h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23H5.904m10.598-9.75H14.25M5.904 18.5c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 0 1-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 9.953 4.167 9.5 5 9.5h1.053c.472 0 .745.556.5.96a8.958 8.958 0 0 0-1.302 4.665c0 1.194.232 2.333.654 3.375Z" />
</svg>

                                <span>0</span>
                            </span>
                            <span
                                title="踩"
                                class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-lg flex items-center"
                            >
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
  <path stroke-linecap="round" stroke-linejoin="round" d="M7.498 15.25H4.372c-1.026 0-1.945-.694-2.054-1.715a12.137 12.137 0 0 1-.068-1.285c0-2.848.992-5.464 2.649-7.521C5.287 4.247 5.886 4 6.504 4h4.016a4.5 4.5 0 0 1 1.423.23l3.114 1.04a4.5 4.5 0 0 0 1.423.23h1.294M7.498 15.25c.618 0 .991.724.725 1.282A7.471 7.471 0 0 0 7.5 19.75 2.25 2.25 0 0 0 9.75 22a.75.75 0 0 0 .75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 0 0 2.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384m-10.253 1.5H9.7m8.075-9.75c.01.05.027.1.05.148.593 1.2.925 2.55.925 3.977 0 1.487-.36 2.89-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398-.306.774-1.086 1.227-1.918 1.227h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 0 0 .303-.54" />
</svg>


                                <span>0</span>
                            </span>
                        </div>
                    </div>

                    <!-- 新增跳转链接区域 -->
                    <div class="mb-2">
                        <h3 class="text-xl font-semibold mb-3">站点操作</h3>
                        <div class="flex space-x-2">
                            <a   th:href="${link.linkUrl}"
                                class="bg-purple-500 hover:bg-purple-600 text-white px-4 py-2 rounded-lg flex items-center"
                            >
                               
                                <span th:title="${link.linkName}" >访问站点</span>
                        </a>
                            <button  data-modal-target="feedback-modal" data-modal-toggle="feedback-modal"
                               
                                class="bg-yellow-500 hover:bg-yellow-600 text-white px-4 py-2 rounded-lg flex items-center"
                            >
                                <i class="fas fa-comment-dots mr-2"></i>
                                <span>网站反馈</span>
                            </button>
                            <button
                                onclick="showQRModal()"
                                class="bg-yellow-500 hover:bg-yellow-600 text-white px-4 py-2 rounded-lg flex items-center"
                            >
                                <i class="fas fa-comment-dots mr-2"></i>
                                <span>扫码查看</span>
                            </button>
                        </div>
                    </div>

                    <div class="mb-2">
                        <h3 class="text-xl font-semibold mb-3">关键词</h3>
                        <span
                            class="bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded-sm dark:bg-blue-900 dark:text-blue-300"
                            >Default</span
                        >
                        <span
                            class="bg-gray-100 text-gray-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded-sm dark:bg-gray-700 dark:text-gray-300"
                            >Dark</span
                        >
                        <span
                            class="bg-red-100 text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded-sm dark:bg-red-900 dark:text-red-300"
                            >Red</span
                        >
                    </div>
                </div>

                <!-- 右侧图片 -->
                <div class="md:w-1/3 pt-16">
                    <img
                        src="https://picsum.photos/400/300?random=1"
                        alt="资源网站展示图"
                        class="w-full h-full rounded-lg shadow"
                    />
                </div>
            </div>
        </div>
    </div>
</div>
</th:block>
<!-- 扫码查看模态框 -->
<div
    id="qrModal"
    class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden"
>
    <div class="bg-white p-6 rounded-lg max-w-sm w-full">
        <div class="flex justify-between items-center mb-4">
            <h3 class="text-xl font-bold">扫码查看</h3>
            <button
                onclick="hideQRModal()"
                class="text-gray-500 hover:text-gray-700"
            >
                <i class="fas fa-times"></i>
            </button>
        </div>
        <div class="text-center">
            <img
                src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=https://example.com"
                alt="网站二维码"
                class="mx-auto mb-4"
            />
            <p class="text-gray-600">使用手机扫描二维码访问</p>
        </div>
    </div>
</div>

<!-- 网站反馈模态框 -->
<div
    id="feedback-modal" tabindex="-1" aria-hidden="true"
    class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full"
>
    <div class="bg-white p-6 rounded-lg max-w-md w-full">
        <div class="flex justify-between items-center mb-4">
            <h3 class="text-xl font-bold">网站反馈</h3>
            <button
                onclick="hideFeedbackModal()"
                class="text-gray-500 hover:text-gray-700"
            >
                <i class="fas fa-times"></i>
            </button>
        </div>
        <form>
            <div class="mb-4">
                <label class="block text-gray-700 mb-2">反馈类型</label>
                <select class="w-full p-2 border rounded">
                    <option>问题反馈</option>
                    <option>功能建议</option>
                    <option>内容举报</option>
                    <option>其他</option>
                </select>
            </div>
            <div class="mb-4">
                <label class="block text-gray-700 mb-2">反馈内容</label>
                <textarea class="w-full p-2 border rounded" rows="4"></textarea>
            </div>
            <div class="mb-4">
                <label class="block text-gray-700 mb-2">联系方式</label>
                <input
                    type="text"
                    class="w-full p-2 border rounded"
                    placeholder="邮箱/电话(选填)"
                />
            </div>
            <button
                type="submit"
                class="w-full bg-blue-500 hover:bg-blue-600 text-white py-2 rounded"
            >
                提交反馈
            </button>
        </form>
    </div>
</div>

<script>
    // 显示扫码模态框
    function showQRModal() {
        document.getElementById("qrModal").classList.remove("hidden");
    }

    // 隐藏扫码模态框
    function hideQRModal() {
        document.getElementById("qrModal").classList.add("hidden");
    }

    // 显示反馈模态框
    function showFeedbackModal() {
        document.getElementById("feedbackModal").classList.remove("hidden");
    }

    // 隐藏反馈模态框
    function hideFeedbackModal() {
        document.getElementById("feedbackModal").classList.add("hidden");
    }
</script>
